package com.example.demo.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * Created by pengwan on 2017/7/26.
 */
@MappedSuperclass
// 提供了持久化实体状态（即属性或字段）和映射信息，本身不是一个实体。目的是定义多个实体共有的状态和映射信息。
public class EntityId {
    @Id
    @GeneratedValue(generator = "uuidGenerator")
    @GenericGenerator(name = "uuidGenerator", strategy = "uuid")
    @Column(name = "id")
    private String id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

}
